﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

using NUnit.Framework;

using NUnitResultsExplorer;

namespace NUnitResultsExplorerTests.Unit
{
    public class NameToStringConverterTests
    {
        [Test]
        [TestCase(null, typeof(String), null, "en-GB", "[Unnamed]")]
        [TestCase("", typeof(String), null, "en-GB", "[Unnamed]")]
        [TestCase("RealName", typeof(String), null, "en-GB", "RealName")]
        public void TestConvert(Object value, Type targetType, Object parameter, String cultureString, Object expectedValue)
        {
            var culture = CultureInfo.GetCultureInfo(cultureString);
            var c = new NameToStringConverter();
            var actualValue = c.Convert(value, targetType, parameter, culture);
            Assert.AreEqual(expectedValue, actualValue);
        }

        [Test, ExpectedException(typeof(NotImplementedException))]
        public void TestConvertBack()
        {
            var culture = CultureInfo.GetCultureInfo("en-GB");
            var c = new NameToStringConverter();
            c.ConvertBack(null, typeof(String), null, culture);
        }
    }
}
